"""
HTTP请求相关异常类
"""

from typing import Optional


class HTTPException(Exception):
    """
    HTTP请求基础异常类
    """
    pass


class ConnectionError(HTTPException):
    """
    连接错误异常
    """
    pass


class TimeoutError(HTTPException):
    """
    超时错误异常
    """
    pass


class SSLError(HTTPException):
    """
    SSL证书错误异常
    """
    pass


class HTTPStatusError(HTTPException):
    """
    HTTP状态码错误异常
    """
    
    def __init__(self, status_code: int, message: Optional[str] = None) -> None:
        self.status_code = status_code
        self.message = message or f"HTTP {status_code} 错误"
        super().__init__(self.message)